<%@ page import="com.education.service.bean.ActivityBean" %>
<%@ page import="java.util.List" %><%--
  Created by IntelliJ IDEA.
  User: Fan307
  Date: 2016/11/7
  Time: 20:55
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width,height=device-height,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>登录成功</title>
</head>

<body>
<style type="text/css">
    body{
        background: url(/images/background3.jpg);
        background-size: 100%;
    }
    select{
        margin: 3px;
    }
    select:hover{
        border:2px solid #666666; //鼠标移上的效果
    }

    div input{margin: 3px;}
    select,input{
        background: transparent;
    }
    #checkout{
        float: right;
    }
    #back{

        float: left;
        margin-left: 70px;
    }
    #forward{
        float: right;
        margin-right: 70px;
    }
    .bottom{
        position: absolute;
        bottom: 50px;
        left: 0;
        height: 20px;
        width: 100%;
    }
</style>
<script language="JavaScript">
    function getSelectedValue( ) {
        var catagory=document.getElementById("catagorySelect").value;
        var school=document.getElementById("schoolSelect").value;
        var major=document.getElementById("majorSelect").value;
        var course=document.getElementById("courseSelect").value;
        var path='res'+ "\\" + catagory + "\\" +school + "\\" + major  + "\\" + course ;
//          return path;
//          window.location.href="getPathServlet?path="+path;
        window.location.href="/Pages/fileUpload.jsp?path="+path;
    }
</script>

<h3>欢迎使用</h3>
<h4>请选择需要上传的分类</h4>
<div >
    <select id="catagorySelect" name="catagoryName">
        <%
            List<ActivityBean> infoCatagortyBean = (List) request.getAttribute("infocatagorybean");
            if(infoCatagortyBean.size() == 0)
            {
                out.println("当前选项为空");
            }
            else {
                for(int i=0;i<infoCatagortyBean.size();i++)
                {
                    String catagoryValue = infoCatagortyBean.get(i).getValue();
                    String catagoryName = infoCatagortyBean.get(i).getName();
        %>
        <option value="<%=catagoryValue%>"><%=catagoryName%></option>
        <%
                }
            }
        %>
    </select><br>

    <select id="schoolSelect" name="schoolName">
        <%
            List<ActivityBean> infoSchoolBean = (List) request.getAttribute("infoschoolbean");
            if(infoSchoolBean.size() == 0)
            {
                out.println("当前选项为空");
            }
            else {
                for(int i=0;i<infoSchoolBean.size();i++)
                {
                    String schoolValue = infoSchoolBean.get(i).getValue();
                    String schoolName = infoSchoolBean.get(i).getName();
        %>
        <option value="<%=schoolValue%>"><%=schoolName%></option>
        <%
                }
            }
        %>
    </select><br>

    <select id="majorSelect" name="majorName">
        <%
            List<ActivityBean> infoMajorBean = (List) request.getAttribute("infomajorbean");
            if(infoMajorBean.size() == 0)
            {
                out.println("当前选项为空");
            }
            else {
                for(int i=0;i<infoMajorBean.size();i++)
                {
                    String majorValue = infoMajorBean.get(i).getValue();
                    String majorName = infoMajorBean.get(i).getName();
        %>
        <option value="<%=majorValue%>"><%=majorName%></option>
        <%
                }
            }
        %>
    </select><br>

    <select id="courseSelect" name="courseName">
        <%
            List<ActivityBean> infoCourseBean = (List) request.getAttribute("infocoursebean");
            if(infoCourseBean.size() == 0)
            {
                out.println("当前选项为空");
            }
            else {
                for(int i=0;i<infoCourseBean.size();i++)
                {
                    String courseValue = infoCourseBean.get(i).getValue();
                    String courseName = infoCourseBean.get(i).getName();
        %>
        <option value="<%=courseValue%>"><%=courseName%></option>
        <%
                }
            }
        %>
    </select><br>

    <input type="button" value="确定" onclick="getSelectedValue()"/>
</div>







<input id="checkout" type="button" onclick="window.location.href = '/LogoutServlet'" value="退出">
<div class="bottom"><img id="back" src="/images/arrow_left_24x24.png" onclick="window.history.back()"><img id="forward" src="/images/arrow_right_24x24.png" onclick="window.history.forward()"></div>
</body>
</html>
